package cn.woblog.android.common.utils;

import android.support.v4.app.FragmentActivity;
import android.view.Display;
import android.view.WindowManager;


/**
 * Created by Administrator on 2015/8/7 0007.
 */
public class DimensionUtils {

    public static int width;
    public static int height;

    public static void init(FragmentActivity activity){
        WindowManager windowManager = activity.getWindowManager();
        Display defaultDisplay = windowManager.getDefaultDisplay();
        width = defaultDisplay.getWidth();
        height = defaultDisplay.getHeight();
    }

    public static int getCenterX(){
        return width/2;
    }

    public static int getCenterY(){
        return height/2;
    }
}
